package com.gitee.kerraway.recursion;

/**
 * @author 小柯
 * @date 2018/3/26
 */
public class Node {

  private final Integer value;
  private Node next;

  public Node(Integer value) {
    this.value = value;
    this.next = null;
  }

  public Integer getValue() {
    return value;
  }

  public Node getNext() {
    return next;
  }

  public void setNext(Node next) {
    this.next = next;
  }

  public static void print(Node head) {
    while (head != null) {
      System.out.printf("%s ", head.getValue());
      head = head.getNext();
    }
    System.out.println("null");
  }

}
